<?php $__env->startSection('css'); ?>
    <style>
        .layer-go-back{
            display:none;
        }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('title'); ?>
    <li class="cur">
        <span>公共设置</span>
    </li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<div class="form-group">
    <label class="col-sm-3 control-label"><span class="red pr5">*&nbsp;</span>是否使用APP：</label>
    <div class="col-sm-9">
        <div class="layui-form">
            <input type="radio" name="is_use_app" id="" value="1" title="开启" <?php if( isset($configure['is_use_app']) && $configure['is_use_app'] == 1 ): ?> checked <?php endif; ?>>
            <input type="radio" name="is_use_app"  value="0" title="关闭" <?php if( !isset($configure['is_use_app']) || $configure['is_use_app'] == 0 ): ?> checked <?php endif; ?> >
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"></label>
    <div class="col-sm-9">
        <input type="hidden" name="function_id" id="function_id" value="<?php echo e(isset($function_id) ? $function_id : ''); ?>">
        <input type="button"  value="保存" onclick="func.edit();" class="btn btn-success" >
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<script>

    layui.use(['form'], function(){
        var form = layui.form();
        });

    var func = {

        //保存
        edit:function(){

            var message_log = '' ;
            var configure = E.getFormValues('edit-form') ;

            //参数判断
            if( E.isEmpty( configure.function_id ) || !E.isInt( configure.function_id ) ) {
                message_log += '参数错误<br/>' ;
            }

            if( message_log ) {
                layer.alert( message_log , { icon:2 });
                return false ;
            }

            layer.confirm("您确认保存该设置吗？",{icon:3,offset:'50px'}, function ( index ){
                layer.close( index );
                E.ajax( {
                    type:'get',
                    url: '/lar/develop/function/store/'+function_id,
                    data: configure,
                    dataType:'json',
                    // 返回值判断
                    success: function ( obj ){

                        if ( obj.code == 200 ) {
                            layer.alert( obj.message , { icon: 1,time : 1500 } ) ;
                        } else {
                            layer.alert( obj.message , { icon: 2 } ) ;
                        }
                    }
                } ) ;
            });
        }
    };
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('develop.layoutEdit', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>